<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/style/basic_layout.css" rel="stylesheet" type="text/css">
<link href="/style/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/jquery/jquery.js"></script>
<script src="/js/plugins/artDialog/jquery.artDialog.js?skin=blue"></script>
<script src="/js/plugins/My97DatePicker/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/js/commonAll.js"></script>
	<script>
		$(function () {
        	$(".Wdate").click(function () {
				WdatePicker({

					//设置最小时间
					minDate:$("input[name='beginTime']").val(),
					readOnly:true,
					//最大时间
					maxDate:new Date(),
				});
            });
        });
	</script>
<title>WMS-订单入库管理</title>
<style>
	.alt td{ background:black !important;}
</style>
</head>
<body>
	<form id="searchForm" action="/stockIncomeBill/list.do" method="post">
		<div id="container">
			<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">搜索</div>
						<div id="box_center">
							业务时间
							<fmt:formatDate value="${qo.beginTime}" var="beginTime"/>
							<input type="text" class="ui_input_txt02 Wdate" name="beginTime" value="${beginTime}"/>~
							<fmt:formatDate value="${qo.endTime}" var="endTime"/>
							<input type="text" class="ui_input_txt02 Wdate" name="endTime" value="${endTime}"/>
							仓库
							<select id="depotId" class="ui_select01" name="depotId">
								<option value="-1">全部</option>
								<c:forEach var="dp" items="${depots}">
									<option value="${dp.id}">${dp.name}</option>
								</c:forEach>
							</select>
							状态
							<select id="status" class="ui_select01" name="status">
								<option value="-1">全部</option>
								<option value="1">未审核</option>
								<option value="2">已审核</option>
							</select>
							<script>
								$("#depotId option[value='${qo.depotId}']").prop("selected",true);
								$("#status option[value='${qo.status}']").prop("selected",true);
							</script>
						</div>
						<div id="box_bottom">
							<input type="button" value="查询" class="ui_input_btn01 but_page"/>
							<input type="button" value="新增" class="ui_input_btn01 btn_input"
							data-url="/stockIncomeBill/input.do"/>
						</div>
					</div>
				</div>
			</div>
			<div class="ui_content">
				<div class="ui_tb">
					<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
						<tr>
							<th width="30"><input type="checkbox" id="all" /></th>
							<th>入库单号</th>
							<th>业务时间</th>
							<th>仓库</th>
							<th>总数量</th>
							<th>总金额</th>
							<th>录入人</th>
							<th>审核人</th>
							<th>状态</th>
							<th></th>
						</tr>
						<c:forEach var="entity" items="${result.data}" varStatus="num">
							<tr>
								<td><input type="checkbox" class="acb" /></td>
								<td>${entity.sn}</td>
								<td><fmt:formatDate value="${entity.vdate}"/></td>
								<td>${entity.depot.name}</td>
								<td>${entity.totalNumber}</td>
								<td>${entity.totalAmount}</td>
								<td>${entity.inputUser.name}</td>
								<td>${entity.auditor.name}</td>
								<td>
									<c:choose>
										<c:when test="${entity.status == 2}">
											<span style="color: red">已审核</span>
										</c:when>
										<c:when test="${entity.status == 1}">
											<span style="color: darkgreen">未审核</span>
										</c:when>
									</c:choose>
								</td>
								<td>
									<c:choose>
										<c:when test="${entity.status == 1}">
											<a href="/stockIncomeBill/input.do?id=${entity.id}">编辑</a>
											<a href="javascript:" class="btn_delete"
											   data-url="/stockIncomeBill/delete.do?id=${entity.id}">删除</a>
											<a href="/stockIncomeBill/audit.do?id=${entity.id}">审核</a>
										</c:when>
										<c:when test="${entity.status == 2}">
											<a href="/stockIncomeBill/view.do?id=${entity.id}">查看</a>
										</c:when>
									</c:choose>
								</td>
							</tr>
						</c:forEach>
					</table>
				</div>
				<%--引入分页操作--%>
				<%@ include file="/WEB-INF/views/common/page.jsp" %>
			</div>
		</div>
	</form>
</body>
</html>
